(function(exports) {
	var gc = gameConfig,
		w = gc.width,
		h = gc.height,
		sp = gc.speed,
		gap = gc.pipeGapY,
		pipeWidth = gc.pipeWidth;

	exports.Pipe = function(pos, height) {
		this.pos = pos || new Vec2();
		this.height = height || 0;
	}

	exports.Pipe.prototype = {
		constructor: Bird,
		draw: function(ctx) {
			ctx.strokeRect(this.pos.x, this.pos.y, pipeWidth, this.height);
		},
		update: function() {
			this.pos.x -= Math.round(sp * gc.secSpan);
		}
	}

	exports.Pipe.createPair = function() {
		var position = ~~(Math.random() * (h - gap));
		return {
			top: new Pipe(new Vec2(w, 0), position),
			bottom: new Pipe(new Vec2(w, position + gap), h - position - gap)
		}
	}
})(window);